<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>通知弹出效果</title>
		<style type="text/css">
			body {
  font-family: 'Roboto', sans-serif;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
}
section {
  background: #01cfa9;
  height: 100vh;
  margin: 0 auto;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  -webkit-box-pack: center;
  -o-box-pack: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-align: center;
  -o-box-align: center;
  -ms-flex-align: center;
  -webkit-align-items: center;
  align-items: center;
}
.section-notification .nav {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  background: #fff;
  color: #333;
  border-radius: 5px;
  box-shadow: 0px 23px 30px -20px rgba(0,0,0,0.3);
  padding: 0;
}
.section-notification .nav > li {
  padding: 20px 30px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  list-style: none;
  color: rgba(0,0,0,0.5);
  position: relative;
  -webkit-perspective: 1000px;
  -ms-perspective: 1000px;
  perspective: 1000px;
}
.section-notification .nav > li:hover {
  background: #eee;
}
.section-notification .nav > li.is-active {
  box-shadow: 0px -7px 0px #05a285 inset;
  background: #dfdfdf;
  color: #333;
  -webkit-transition: 0.3s ease;
  transition: 0.3s ease;
}
.section-notification .nav > li.is-active .notifications {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: box;
  display: flex;
  -webkit-animation: note 0.7s ease-in-out forwards;
  animation: note 0.7s ease-in-out forwards;
  -webkit-transform-origin: center 60px;
  transform-origin: center 60px;
}
@-webkit-keyframes note {
  0% {
    opacity: 0;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: alpha(opacity=0);
    -webkit-transform: scale(0.1) rotate(30deg) translateY(50px);
    transform: scale(0.1) rotate(30deg) translateY(50px);
  }
  50% {
    -webkit-transform: rotate(-10deg);
    transform: rotate(-10deg);
    opacity: 1;
    -ms-filter: none;
    -webkit-filter: none;
            filter: none;
  }
  70% {
    -webkit-transform: rotate(5deg);
    transform: rotate(5deg);
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
@keyframes note {
  0% {
    opacity: 0;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: alpha(opacity=0);
    -webkit-transform: scale(0.1) rotate(30deg) translateY(50px);
    transform: scale(0.1) rotate(30deg) translateY(50px);
  }
  50% {
    -webkit-transform: rotate(-10deg);
    transform: rotate(-10deg);
    opacity: 1;
    -ms-filter: none;
    -webkit-filter: none;
            filter: none;
  }
  70% {
    -webkit-transform: rotate(5deg);
    transform: rotate(5deg);
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
.section-notification .notifications {
  list-style: none;
  background: #05a285;
  display: none;
  border-radius: 4px;
  position: absolute;
  bottom: 100%;
  left: 50%;
  padding: 0px 10px;
  margin: 0 0 10px -88px;
  cursor: default;
  color: #fff;
}
.section-notification .notifications:after {
  position: absolute;
  top: 100%;
  left: 50%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  border-top-color: #05a285;
  border-width: 16px;
  margin-left: -16px;
  pointer-events: none;
}
.section-notification li {
  padding: 6px;
  font-family: 'Roboto', sans-serif;
  color: #fff;
  font-size: 0.6em;
}
.section-notification li .material-icons {
  font-size: 24px;
}
.section-notification li span {
  display: inline-block;
  vertical-align: top;
  margin: 4px;
}

		</style>
	</head>
	<body>
		<link href='https://fonts.googleapis.com/css?family=Roboto:400,700' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<section class="section-notification">
  <ul class="nav">
    <li><i class="material-icons">home</i></li>
    <li><i class="material-icons">search</i></li>
    <li class="is-active"><i class="material-icons">star
        <ul class="notifications">
          <li><i class="material-icons">remove_red_eye</i><span>9</span></li>
          <li><i class="material-icons">comment</i><span>4</span></li>
          <li><i class="material-icons">account_circle</i><span>6</span></li>
        </ul></i></li>
    <li><i class="material-icons">face</i></li>
  </ul>
</section>
<script type="text/javascript">
	
	var elems = document.getElementsByClassName("nav")[0].getElementsByTagName("li");
for (var i = 0; i < elems.length; i++) {
  elems[i].addEventListener("click", function(e) {
    for (var i = 0; i < elems.length; i++) {
      elems[i].className = "";
    };
    this.className = "is-active";
  });
}
</script>
	</body>
</html>
